package net.lab1024.sa.user.module.system.user.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.lab1024.sa.common.common.domain.RequestUser;
import net.lab1024.sa.common.common.domain.ResponseDTO;
import net.lab1024.sa.common.common.util.SmartRequestUtil;
import net.lab1024.sa.user.constant.UserSwaggerTagConst;
import net.lab1024.sa.user.module.system.user.domain.vo.LoginUserDetail;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = UserSwaggerTagConst.System.USER)
public class UserController {

    @ApiOperation("获取用户信息")
    @PostMapping("/user/info")
    public ResponseDTO<LoginUserDetail> getUserInfo(){
        RequestUser requestUser = SmartRequestUtil.getRequestUser();
        LoginUserDetail loginUserDetail=(LoginUserDetail)requestUser;
        return ResponseDTO.ok(loginUserDetail);
    }
}
